1. Field of the Invention
The present invention relates to a technique for analyzing a pointer, and in particular to a technique for detecting a position to access an object for which it is desired to detect an access position.
2. Description of Related Art
An object-oriented program, such as a Java™ program, dynamically allocates a lot of objects in a memory heap area and accesses the objects. This brings about increase in CPU cache misses and restriction of the memory band width due to accesses to the objects. Therefore, it is important for a developer and in an optimization process by a compiler to understand where and how the object-oriented program accesses the allocated objects to optimize the use of the CPU cache and memory band width during execution of the object-oriented program. Accordingly, methods for detecting a position to access an object have been developed.
Frederic Vivien et al., “Incrementalized Pointer and Escape Analysis”, [online], ACM 089791886/97/05, 2001, the Internet <URL http://people.csail.mitedu/rinard/paper/pldi01.pdf> shown below describes escape analysis (“Abstract” and “7.1 Escape Analysis”).
Rebecca Hasti et al., “Using Static Single Assignment Form to Improve Flow-Insensitive Pointer Analysis”, [online], ACM 0-89791-987-4/98/0006, 1998, the Internet <URL http://www.cs.purdue.edu/homes/suresh/590s-Fall2002/papers/hasti98using.pdf> shown below describes that pointer analysis can be flow-sensitive or flow-insensitive (“Abstract”).
Sanjay Ghemawat et. Al., “Field Analysis: Getting Useful and Low-cost Interprocedural Information”, [online], 2000, the Internet <URL http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.78.8889&rep=rep1&type=pdf > shown below describes field analysis (“Abstract”). The field analysis determines useful characteristics of a field of an object by scanning a code which can probably access the field (p. 1, right column, 4th paragraph, 1.1-3). For example, a private field in Java™ can be accessed only by a method in a local class (p. 1, right column, 4th paragraph, 1.3-5).
Ran Shaham et. Al., “Heap profiling for Space-Efficient Java”, [online], ACM 1-58113-414-2/01/06, 2001, the Internet <URL http://www.cs.tau.ac.il/{tilde over ( )}msagiv/pldi01.pdf> shown below describes: “For an instance field we inspect the code according to visibility modifiers of the field, e.g., for a private field we inspect only the code of the containing class” (p. 107, “3.3.1 Assigning Null”, right column 1.3-5).
National Publication of International Patent Application No. 2005-535055 shown below describes “alias analysis” (paragraph 0140) and describes: “alias analysis can be more accurate or not so accurate depending on whether a control flow is considered or not. If the control flow is considered, it is called flow-sensitive, and otherwise, it is called flow-insensitive. By the flow-sensitive alias analysis, it can be detected in which block two objects are aliased along a path. Since this is more accurate, it is more complicated, and the calculation is more difficult. Ordinarily, flow-insensitive information is sufficient. This point of view is shown in FIG. 14. In this case, it is known by flow-insensitive analysis that p is an alias of b, and it is known by flow-sensitive analysis that p is the alias of b only in a block B2” (paragraph 0142).
Japanese Patent Laid-Open No. 2003-122628 shown below describes that a program conversion apparatus is provided with simulation means for, when generating an instruction code for controlling hardware from a source program describing a signal processing procedure, analyzing the signal processing procedure of the source program in advance and recording a history of the use frequency of address pointer registers in the source program, and a register use instruction to use an address pointer register with a high use frequency is changed to an address pointer register use instruction corresponding to the bank group decoder on the basis of the history of the use frequency of the address pointer registers in the source program obtained by the simulation means.
Japanese Patent Laid-Open No. H10-21078 shown below describes that, in a programming language processing system which combines multiple data definitions to hold a new combined view definition, a combined view reference expression compiling system is provided with means for analyzing the sentence structure of a source code, means for analyzing type information about the analyzed sentence structure and generating a type information table, means for generating a reference code by referring to the type information table and means for outputting a developed code.
Japanese Patent Laid-Open No. 2004-362216 shown below describes that a compiler apparatus is further provided with an execution frequency information measuring section measuring, for each of at least a part of instructions included in a target program, the execution frequency of the instruction by executing the target program; and, if the execution frequency of the detected exclusion-from-optimization instruction by the execution frequency information measuring section is higher than a predetermined first frequency, the instruction group selecting section selects the exclusion-from-optimization instruction as the optimization target instruction group, and, if the execution frequency of the detected exclusion-from-optimization instruction by the execution frequency information measuring section is lower than a second frequency set to a value lower than the first frequency, the instruction group selecting section selects the optimization target instruction as the exclusion-from-optimization instruction.